Skip to content

Conversation

@Kielek
Copy link
Member

@Kielek Kielek commented Sep 16, 2025

Why

Towards #4394
Extracted and refactored from #4270

What

File based configuration for resources.

Note

File based configuration should block any direct reads from environmental variables. In this case, it means that Environmental Variable resource detector is not used.

Intentionally keeping documentation and changelog outside scope of this PR. I think that for documentation we need at least one more PR (resource detectors).

Changelog should be mentioned only when we decide ask the end-users to test it.

Tests

CI + added tests

Checklist

  • [ ] CHANGELOG.md is updated.
  • [ ] Documentation is updated.
  • New features are covered by tests.

@Kielek Kielek force-pushed the filebasedconfig-resources branch from 33e7e00 to 77bc6b7 Compare September 16, 2025 09:34
@Kielek Kielek force-pushed the filebasedconfig-resources branch from de21a27 to 91d64bb Compare September 16, 2025 10:44
detection of these attributes was moved to resourceconfigurator
@Kielek Kielek marked this pull request as ready for review September 16, 2025 11:52
@Kielek Kielek requested a review from a team as a code owner September 16, 2025 11:52
@RassK
Copy link
Contributor

RassK commented Sep 16, 2025

Will you address the TODOs here or later?

@Kielek
Copy link
Member Author

Kielek commented Sep 16, 2025

Will you address the TODOs here or later?

Follow up PRs. I would like to avoid making this PR bigger.

@Kielek Kielek requested a review from RassK September 17, 2025 09:56
Copy link
Contributor

@RassK RassK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general seems fine as follow ups seem to come anyway and fix some of the parts per time.

/// <summary>
/// Gets or sets the list of enabled resources.
/// </summary>
public IReadOnlyList<KeyValuePair<string, object>> Resources { get; set; } = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the future, may want to use union ref struct not to cause object boxing for simple types.

Comment on lines +57 to +59
protected virtual void OnLoadFile(YamlConfiguration configuration)
{
}
Copy link
Contributor

@ysolomchenko ysolomchenko Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this method should also be abstract in the future. It’s worth adding a TODO: that once the implementation is done in all settings, it should be changed to abstract.

Co-authored-by: Yevhenii Solomchenko <[email protected]>
@Kielek
Copy link
Member Author

Kielek commented Sep 19, 2025

@rajkumar-rangaraj, @nrcventura, @zacharycmontoya. I am going to merge to unblock further work on this tasks and NoCode feature.
Please let me know if you have any comments. I will try to address in the follow ups.

@Kielek Kielek merged commit 3afe204 into open-telemetry:main Sep 19, 2025
80 of 81 checks passed
@Kielek Kielek deleted the filebasedconfig-resources branch September 19, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants